package dingding.使用线程;

public class Demo1 {

    public static void doSomethingA(){
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("-----doSomethingA");
    }

    public static void doSomethingB(){
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("-----doSomethingB");
    }

    public static void main(String[] args) {
        Long start = System.currentTimeMillis();
        doSomethingA();
        doSomethingB();
        Long end = System.currentTimeMillis();
        System.out.println(end-start);
    }
}
